<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_model extends CI_Model{
	
	function __construct(){
		parent::__construct();
		$this->load->database();
		}
		
	function add($user){
		$this->db->insert('user_facebook', $user);
		}
			
	function update($userid, $user){
		$this->db->where('user_facebook.id_user', $userid);
		$this->db->update('user_facebook', $user);
		}
		
	function delete($userid){
		$this->db->where('user_facebook.id_user', $userid);
		$this->db->delete('user_facebook');
		}
		
	function get_user($userid){
		$this->db->select('*');
		$this->db->from('user_facebook');
		$this->db->where('user_facebook.id_user', $userid);
		$result = $this->db->get();
		return $result;
		}
	
}
